<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="login_logout.*" %>
<% 
   login in = new login();
   String name = request.getParameter("user");
   String pass = request.getParameter("password");
   boolean isLoginSucc = in.Login(name, pass);
   if(isLoginSucc)
   {
	   out.println("<script>alert('登陆成功！');window.location.href='../index.jsp'</script>");
	   session.setAttribute("user", name);
	   session.setMaxInactiveInterval(60);
   }
   else
   {
	   out.println("<script>alert('登陆失败！');window.location.href='../login.jsp'</script>");
   }
%>
